import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsString, IsNotEmpty } from 'class-validator';

export class CreatePhotoDto {
  @ApiProperty({
    description: '账户id',
    type: Number,
  })
  @IsNumber()
  @IsNotEmpty({ message: 'Id 不能为空' })
  readonly id: number;

  @ApiProperty({ required: true })
  @IsString()
  name: string;

  @ApiProperty({ required: true })
  @IsString()
  description: string;

  @ApiProperty({ required: false })
  @IsString()
  filename: string;

  @ApiProperty()
  @IsNumber()
  views: number;

  @ApiProperty()
  @IsString()
  isPublished: boolean;
}
